package com.zoshine.zzg.pojo.pojostatus;

import java.util.Objects;

/**
 * 犯人信息状态枚举
 *
 * @author mazefei
 * @time  2017.11.8
 */
public enum PrisonerAccountStatus {
    SUCCESS_NOBACK(0,"开卡成功,未返回"),
    SUCCESS_BACK(1,"开卡成功,已返回"),
    FAIL_NOBACK(2, "开卡失败，未返回"),
    FAIL_BACK(3, "开卡失败，已返回");

    private int value;
    private String desc;
    PrisonerAccountStatus(final int value, final String desc) {
        this.value = value;
        this.desc = desc;
    }

    public int getValue() {
        return value;
    }

    public static String getDesc(Integer value) {
        for (PrisonerAccountStatus userStatus : PrisonerAccountStatus.values()) {
            if (Objects.equals(userStatus.value, value)) {
                return userStatus.desc;
            }
        }
        return null;
    }
}
